package Convert_2_8_10_16;

public class Solution {
	public String base10Tobase16(int num) {
		String[] map = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" };
		StringBuilder sb = new StringBuilder();

		while (num != 0) {
			sb.append(map[num % 16]);
			num/=16;
		}
		sb.reverse();
		return sb.toString();
	}
}
